package cn.exrick.xboot.modules.content.serviceimpl;

import cn.exrick.xboot.common.vo.SearchVo;
import cn.exrick.xboot.modules.base.dao.RoleDao;
import cn.exrick.xboot.modules.base.entity.Role;
import cn.exrick.xboot.modules.content.dao.HontRoleDao;
import cn.exrick.xboot.modules.content.entity.HontRole;
import cn.exrick.xboot.modules.content.entity.HontVo.HontRoleLevelVo;
import cn.exrick.xboot.modules.content.service.HontRoleService;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.criteria.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 测试接口实现
 * @author Exrick
 */
@Slf4j
@Service
@Transactional
public class HontRoleServiceImpl implements HontRoleService {

    @Autowired
    private HontRoleDao hontRoleDao;


    @Override
    public HontRoleDao getRepository() {
        return hontRoleDao;
    }

    @Override
    public List<HontRole> findByDefaultRole(Boolean defaultRole) {
        return hontRoleDao.findByDefaultRole(defaultRole);
    }

    @Override
    public HontRole findByName(String name) {
        return hontRoleDao.findByName(name);
    }

    @Override
    public List<HontRole> findByNameLike(String name) {
        return hontRoleDao.findByNameLike(name);
    }

    @Override
    public HontRole findHontRoleByUserId(String userId) {
        return hontRoleDao.findHontRoleByUserId(userId);
    }

    @Override
    public List<HontRoleLevelVo> findRoleLevelById() {
        return hontRoleDao.findRoleLevelById();
    }

}